﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="Finance.aspx.cs" Inherits="Companies_Products" Title="Продукти на Клиенти" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
        &nbsp;</p>
    <p>
    СПИСЪК НА ПРОДУКТИТЕ
        НА КЛИЕНТ:
    </p>
    <p>
        <asp:GridView ID="gvItems" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ItemID" DataSourceID="sdsItems">
            <Columns>
                <asp:BoundField DataField="ItemCode" HeaderText="Код" 
                    SortExpression="ItemCode" />
                <asp:BoundField DataField="NameBG" HeaderText="Име БГ" 
                    SortExpression="NameBG" />
                <asp:BoundField DataField="NameEN" HeaderText="Име АН" 
                    SortExpression="NameEN" />
                <asp:BoundField DataField="Name" HeaderText="Клиент" SortExpression="Name" />
                <asp:BoundField DataField="Expr1" HeaderText="Доставчик" 
                    SortExpression="Expr1" />
                <asp:BoundField DataField="EXW1" HeaderText="EXW в EUR без обков" 
                    SortExpression="EXW1" />
                <asp:BoundField DataField="EXW2" HeaderText="EXW в ЛВ без обков" 
                    SortExpression="EXW2" />
                <asp:BoundField DataField="EXW3" HeaderText="EXW цена на обкова в ЛВ" 
                    SortExpression="EXW3" />
                <asp:BoundField DataField="EXW4" HeaderText="EXW цена в EUR с обков" 
                    SortExpression="EXW4" />
                <asp:BoundField DataField="EXW5" HeaderText="EXW цена в ЛВ с обков" 
                    SortExpression="EXW5" />
                <asp:BoundField DataField="DDU1_EUR" HeaderText="DDU цена в EUR без обков" 
                    SortExpression="DDU1_EUR" />
                <asp:BoundField DataField="DDU2_EUR" HeaderText="DDU цена на обкова в EUR" 
                    SortExpression="DDU2_EUR" />
                <asp:BoundField DataField="DDUEUR" HeaderText="DDU цена с обков в EUR" 
                    SortExpression="DDUEUR" />
                <asp:BoundField DataField="DDUBGN" HeaderText="DDU цена с обков в ЛВ" 
                    SortExpression="DDUBGN" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="sdsItems" runat="server" 
            ConflictDetection="CompareAllValues" 
            ConnectionString="<%$ ConnectionStrings:KonturConnectionString %>" 
            DeleteCommand="DELETE FROM [Items] WHERE [ItemID] = @original_ItemID AND [ItemCode] = @original_ItemCode AND [NameBG] = @original_NameBG AND [NameEN] = @original_NameEN AND [CustomerID] = @original_CustomerID AND [SupplierID] = @original_SupplierID AND [EXW1] = @original_EXW1 AND [EXW2] = @original_EXW2 AND [EXW3] = @original_EXW3 AND [EXW4] = @original_EXW4 AND [EXW5] = @original_EXW5 AND [DDU1_EUR] = @original_DDU1_EUR AND [DDU2_EUR] = @original_DDU2_EUR AND [DDUEUR] = @original_DDUEUR AND [DDUBGN] = @original_DDUBGN" 
            InsertCommand="INSERT INTO [Items] ([ItemCode], [NameBG], [NameEN], [CustomerID], [SupplierID], [EXW1], [EXW2], [EXW3], [EXW4], [EXW5], [DDU1_EUR], [DDU2_EUR], [DDUEUR], [DDUBGN]) VALUES (@ItemCode, @NameBG, @NameEN, @CustomerID, @SupplierID, @EXW1, @EXW2, @EXW3, @EXW4, @EXW5, @DDU1_EUR, @DDU2_EUR, @DDUEUR, @DDUBGN)" 
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="SELECT Items.ItemID, Items.ItemCode, Items.NameBG, Items.NameEN, Items.CustomerID, Items.SupplierID, Items.EXW1, Items.EXW2, Items.EXW3, Items.EXW4, Items.EXW5, Items.DDU1_EUR, Items.DDU2_EUR, Items.DDUEUR, Items.DDUBGN, Customers.Name, Suppliers.Name AS Expr1 FROM Items INNER JOIN Customers ON Items.CustomerID = Customers.CustomerID INNER JOIN Suppliers ON Items.SupplierID = Suppliers.SupplierID WHERE (Items.CustomerID = @CustomerID)" 
            UpdateCommand="UPDATE [Items] SET [ItemCode] = @ItemCode, [NameBG] = @NameBG, [NameEN] = @NameEN, [CustomerID] = @CustomerID, [SupplierID] = @SupplierID, [EXW1] = @EXW1, [EXW2] = @EXW2, [EXW3] = @EXW3, [EXW4] = @EXW4, [EXW5] = @EXW5, [DDU1_EUR] = @DDU1_EUR, [DDU2_EUR] = @DDU2_EUR, [DDUEUR] = @DDUEUR, [DDUBGN] = @DDUBGN WHERE [ItemID] = @original_ItemID AND [ItemCode] = @original_ItemCode AND [NameBG] = @original_NameBG AND [NameEN] = @original_NameEN AND [CustomerID] = @original_CustomerID AND [SupplierID] = @original_SupplierID AND [EXW1] = @original_EXW1 AND [EXW2] = @original_EXW2 AND [EXW3] = @original_EXW3 AND [EXW4] = @original_EXW4 AND [EXW5] = @original_EXW5 AND [DDU1_EUR] = @original_DDU1_EUR AND [DDU2_EUR] = @original_DDU2_EUR AND [DDUEUR] = @original_DDUEUR AND [DDUBGN] = @original_DDUBGN">
            <SelectParameters>
                <asp:QueryStringParameter Name="CustomerID" QueryStringField="CustomerID" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="original_ItemID" Type="Int32" />
                <asp:Parameter Name="original_ItemCode" Type="String" />
                <asp:Parameter Name="original_NameBG" Type="String" />
                <asp:Parameter Name="original_NameEN" Type="String" />
                <asp:Parameter Name="original_CustomerID" Type="Int32" />
                <asp:Parameter Name="original_SupplierID" Type="Int32" />
                <asp:Parameter Name="original_EXW1" Type="Decimal" />
                <asp:Parameter Name="original_EXW2" Type="Decimal" />
                <asp:Parameter Name="original_EXW3" Type="Decimal" />
                <asp:Parameter Name="original_EXW4" Type="Decimal" />
                <asp:Parameter Name="original_EXW5" Type="Decimal" />
                <asp:Parameter Name="original_DDU1_EUR" Type="Decimal" />
                <asp:Parameter Name="original_DDU2_EUR" Type="Decimal" />
                <asp:Parameter Name="original_DDUEUR" Type="Decimal" />
                <asp:Parameter Name="original_DDUBGN" Type="Decimal" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="ItemCode" Type="String" />
                <asp:Parameter Name="NameBG" Type="String" />
                <asp:Parameter Name="NameEN" Type="String" />
                <asp:Parameter Name="CustomerID" Type="Int32" />
                <asp:Parameter Name="SupplierID" Type="Int32" />
                <asp:Parameter Name="EXW1" Type="Decimal" />
                <asp:Parameter Name="EXW2" Type="Decimal" />
                <asp:Parameter Name="EXW3" Type="Decimal" />
                <asp:Parameter Name="EXW4" Type="Decimal" />
                <asp:Parameter Name="EXW5" Type="Decimal" />
                <asp:Parameter Name="DDU1_EUR" Type="Decimal" />
                <asp:Parameter Name="DDU2_EUR" Type="Decimal" />
                <asp:Parameter Name="DDUEUR" Type="Decimal" />
                <asp:Parameter Name="DDUBGN" Type="Decimal" />
                <asp:Parameter Name="original_ItemID" Type="Int32" />
                <asp:Parameter Name="original_ItemCode" Type="String" />
                <asp:Parameter Name="original_NameBG" Type="String" />
                <asp:Parameter Name="original_NameEN" Type="String" />
                <asp:Parameter Name="original_CustomerID" Type="Int32" />
                <asp:Parameter Name="original_SupplierID" Type="Int32" />
                <asp:Parameter Name="original_EXW1" Type="Decimal" />
                <asp:Parameter Name="original_EXW2" Type="Decimal" />
                <asp:Parameter Name="original_EXW3" Type="Decimal" />
                <asp:Parameter Name="original_EXW4" Type="Decimal" />
                <asp:Parameter Name="original_EXW5" Type="Decimal" />
                <asp:Parameter Name="original_DDU1_EUR" Type="Decimal" />
                <asp:Parameter Name="original_DDU2_EUR" Type="Decimal" />
                <asp:Parameter Name="original_DDUEUR" Type="Decimal" />
                <asp:Parameter Name="original_DDUBGN" Type="Decimal" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ItemCode" Type="String" />
                <asp:Parameter Name="NameBG" Type="String" />
                <asp:Parameter Name="NameEN" Type="String" />
                <asp:Parameter Name="CustomerID" Type="Int32" />
                <asp:Parameter Name="SupplierID" Type="Int32" />
                <asp:Parameter Name="EXW1" Type="Decimal" />
                <asp:Parameter Name="EXW2" Type="Decimal" />
                <asp:Parameter Name="EXW3" Type="Decimal" />
                <asp:Parameter Name="EXW4" Type="Decimal" />
                <asp:Parameter Name="EXW5" Type="Decimal" />
                <asp:Parameter Name="DDU1_EUR" Type="Decimal" />
                <asp:Parameter Name="DDU2_EUR" Type="Decimal" />
                <asp:Parameter Name="DDUEUR" Type="Decimal" />
                <asp:Parameter Name="DDUBGN" Type="Decimal" />
            </InsertParameters>
        </asp:SqlDataSource>
    </p>
    </asp:Content>

